package com.breeze.components.web.config;

import com.breeze.components.web.interceptor.WebInvokeTimeInterceptor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 通用配置
 *
 * @author breeze
 */
@AutoConfiguration
public class WebInvokeTimeConfig implements WebMvcConfigurer {

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    // 全局访问性能拦截
    registry.addInterceptor(new WebInvokeTimeInterceptor());
  }
}
